#ifndef _THREADPOOL_H_
#define _THREADPOOL_H_
#include "queue.h"
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <string.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
struct threadpool
{
    sem_t semw;
    sem_t semr;
    pthread_mutex_t mutex;

    struct queue *que;
    pthread_t *tids;
    int queue_length_max;
    int threads;
};
struct threadpool *create_threadpool(int threads, int queue_length, void *(*con)(void *));
void destroy_threadpool(struct threadpool *pool);

#endif
